\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
% NCS:  This doesn't appear to be used and I don't have it installed
%\usepackage{ucs}
\usepackage{graphicx}
\usepackage{pifont}
\usepackage{tipa}
\usepackage{pstricks,colortab}

\author{by Julien~Eychenne}
\title{OTableau\\A \LaTeX-friendly editor for Optimality Theory}

\newcommand{\ipa}{\textipa}
\newcommand{\hand}{\ding{43}}

\begin{document}
\maketitle

\section{Overview}

OTableau is a cross-platform WYSIWYG\footnote{What You See Is What You Get} editor for Optimality Theory (OT) tableaux. Its features include : 

\begin{itemize}
\item \LaTeX code generation, with optional cell shading
\item auto-location of fatal violations
\item auto-location of winner(s)
\item factorial typology
\item import/export of CSV (tab separated files) 
\item cross-platform (tested under Windows, Mac OS X and Linux)
% \item XML-based file format
\item dropping of CSV and OTABLEAU files on OTableau's icon (Mac OS X only) 
\end{itemize}

New features in version 1.8 are :

\begin{itemize}
\item Display and \LaTeX{} generation of relative tableaux.
\item Multiple window interface, similar to that used by Microsoft Word.
\item Streamlined \LaTeX{} pasting.
\item Recursive constraint demotion.
\item Limited import and export of OTSoft tableaux--the first tableau
  in each table only.
\end{itemize}


\section{Installation}

OTableau is written in Python. Python is a programming language which is free (open source) and which runs on many platforms. The drawback is that you need Python to be installed on your computer for OTableau to work.

\subsection{Windows}

\subsubsection{The easy way (without Python)}

Download (you should have done it already if you are reading this\dots) the stand alone version for windows. Unzip it: this will produce a directory called \texttt{OTableau}. Move this directory wherever you want on you computer (for instance, in \texttt{Program files}), and run the program \texttt{OTableau(.exe)}. I suggest you add a shortcut pointing to it on your desktop. For the program to work properly, it is crucial that all files remain in the same directory. If for some reason this version didn't work (it has only been tested with Windows XP), try with the instructions below.

\subsubsection{The usual way (with Python)}

Getting Python working under Windows is easy if you follow these instructions. First, download ActivePython from Activestate\footnote{\texttt{http://www.activestate.com/}}. Unless you know what you're doing, you want to download the MSI package for Windows x86. Install ActivePython as any Windows program, then unzip \texttt{OTableau.zip}: this will create a folder named OTableau. Move this folder wherever you want (for instance in your Documents). To run OTableau, you only need to double-click the \texttt{OTableau.pyw}\footnote{Do not try to run \texttt{otableau}, this file is for Unix systems.} file (make sure extensions are not hidden). To make things even easier, you can create a shortcut on your desktop.\\

To read the documentation from within OTableau, you will need to have Acrobat Reader installed. OTableau will check its presence every time you run it. This behaviour can be disabled by editing the \texttt{config} file (with bloc-note) and switching \texttt{check\_acrobat} to \texttt{no}. Make sure you save the file as a plain text file, with no extension whatsoever.

\subsection{Mac OS X}

OTableau is provided as a (huge 5 MB) standalone bundle for Mac OS X. It reportedly works on Panther and Tiger. This bundle includes everything you need.\\


If for some reason it didn't work for you, you may want to try the
running the source directly. You can find it at \\
\texttt{http://otableau.googlecode.com/files/otableau-src-1\_8.zip}. If
you have OS 10.4 or higher, this is all you need. For 10.3 or earlier,
you also need to install the newest version of Python. You can find the installer at
\texttt{http://python.org/download/}.

You should be able to run OTableau by double-clicking
\texttt{otableau.py}. If you experience any trouble, please contact me
(see my address below).

\subsection{Linux/Unix}

On other Unix-like systems, just check that you have python and
Tkinter installed. This can be done by calling \texttt{python} from
the command line, and then inputting \texttt{import Tkinter}. If there
is no error, everything is right! Make sure otableau is executable
(\texttt{chmod +x otableau}) and run it:
\texttt{/path/to/otableau}. Contact me if you have any problem.\\

The default PDF viewer is Acrobat reader (\texttt{acroread}). If you
prefer xpdf or kpdf (or whatever else), you may want to change the
\texttt{unix\_pdf\_viewer} in the \texttt{config} file.



\section{Usage}

Using OTableau is straightforward once you get it installed. The main window looks like the one in figure (\ref{main}):

\begin{figure}[h]
\begin{center}
\includegraphics*[scale=0.65]{main_windows.pdf}
\end{center}
\caption{Main window under Windows}
\label{main}
\end{figure}

\subsection{Editing your grammar}

You can use the example grammar from the \texttt{Help} menu. The first row contains constraints, with the input in the leftmost cell. Other rows contain candidates and their constraint violations. Modifying your grammar is made by using the commands in the \texttt{Grammar} menu.\\

You do not need (actually, you must not!) type in fatal violations: they are computed when you click the \texttt{Eval} button (or click \texttt{Eval} from the \texttt{Grammar} menu. Optimal candidate(s) are shown with a yellowish colour.\\

You can save and open grammars in \texttt{.otableau} format. OTableau
files are actually zipped XML files. You also have the opportunity to
import/export grammars as CSV files (tab separated). You can also
import and export OTSoft CSV files, but unfortunately only the first tableau in each
file.

\subsection{Generating \LaTeX code}


Pressing the \texttt{LaTeX code} button will display the \LaTeX source code corresponding to your grammar. It will vary according to your grammar being evaled or not and cell-shading being enabled or not. Here is the source code generated for a simple grammar:


\begin{verbatim}
\begin{tabular}{|rrl||c|c|c|}\hline
\multicolumn{3}{|c||}{/\ipa{tEt}/} & \textsc{Max} & 
\textsc{Dep} & \textsc{NoCoda} \\ \hline\hline
\LCC
&&  & &\lightgray &\lightgray \\ \hline
a. &  & \ipa{tE} & *! &   &  \\ \hline
\ECC
\LCC
&&  &  & &\lightgray \\ \hline
b. & \hand & \ipa{tEt} &   &  & * \\ \hline
\ECC
\LCC
&&  &  & &\lightgray \\ \hline
c. &  & \ipa{tEti} &   & *! &  \\ \hline
\ECC
\end{tabular}
\end{verbatim}

\noindent And here is the result once it has been compiled:\\


\begin{tabular}{|rrl||c|c|c|}\hline
\multicolumn{3}{|c||}{/\ipa{tEt}/} & \textsc{Max} & \textsc{Dep} & \textsc{NoCoda} \\ \hline\hline
\LCC
&&  & &\lightgray &\lightgray \\ \hline
a. &  & \ipa{tE} & *! &   &  \\ \hline
\ECC
\LCC
&&  &  & &\lightgray \\ \hline
b. & \hand & \ipa{tEt} &   &  & * \\ \hline
\ECC
\LCC
&&  &  & &\lightgray \\ \hline
c. &  & \ipa{tEti} &   & *! &  \\ \hline
\ECC
\end{tabular}
\\

Candidates are indexed automatically. Because of that, you cannot generate \LaTeX code for a grammar that has more than 26 candidates. This should not be much of a problem, though.\\

It is also noteworthy that candidates and the input are automatically surrounded with an IPA environment, while constraints are written in small capitals.


\subsection{Recursive Constraint Demotion}

Recursive constraint demotion support is still rudimentary. There is
no way to display strata consisting of multiple constraints even when
the algorithm generates one. To use constraint demotion, identify the
candidate that will win once constraint demotion has finished. Then
move this candidate to the top so that it is the first candidate in
the tableau. Finally, choose \texttt{Recursive Constraint Demotion} from the
\texttt{Grammar} menu.

% \subsection{Factorial typology}

% OTableau's possibilities for factorial typology are rather limited,
% and not as powerful as what one can find in Bruce Hayes'
% OTSoft. Still, it provides helpful information about which rankings
% generate which candidates. Computation of factorial typology is fast
% or reasonably fast for small grammars (up to 7 or 8) on modern
% hardware. Computation of grammars with 9 or more constraints will be
% slow, and will require recent hardware with a huge amount of
% memory\footnote{I have tried to compute a 10-constraint grammar on a
%   powerbook with a 1.25GHz processor and 512Mb of RAM, but I gave up
%   after 15 minutes and it was only computing possible rankings\dots}.

\section{Acknowledgements}

OTableau has been made possible thanks to the advice found on Doug Arnold's ‘‘\LaTeX~ for linguists'' website, especially the page dedicated to OT tableaux\footnote{\texttt{http://www.essex.ac.uk/linguistics/clmt/latex4ling/OT/4ling/OT}}. I want to express my gratitude to all the contributors.\\

People from the forum MacBidouille must also be thanked for testing the Mac bundle.

\section{Contact}

You can contact me at \texttt{jeychenne@gmail.com}. I would appreciate if you notified me of any bug or ways to improve the tool. While bugs will be fixed as soon as possible, new features will not be added before October 2006.

\end{document}
